import { axios } from '@/utils/request'

const api = {
  getList: '/plugins/integral/goods/list',
  getGoods: '/plugins/integral/goods/detail',
  attr: '/plugins/integral/goods/attr',
  status: '/plugins/integral/goods/status',
  saveGoods: '/plugins/integral/goods/save',
  deleteGoods: '/plugins/integral/goods/delete',
  cat: '/plugins/integral/goods/cat',
  orderList: '/plugins/integral/order/list',
  setting: '/store/integral-setting',
  saveSetting: '/store/integral-setting-save',
  // 积分商城分类列表
  catList:'/integral/cat-list',
  // 积分商城保存编辑分类
  saveCat:'/integral/cat-save',
  // 积分商城删除分类
  delCat:'/integral/cat-del',
  // 改变商城分类状态
  catStatus:'/integral/cat-status',
  // 积分商城保存设置
  storeSetting:'/integral/setting',
  // 积分商城所有分类
  allCatList:'/integral/cat-all'
}

export default api

export function goodsList (parameter) {
  return axios({
    url: api.getList,
    method: 'get',
    params: parameter
  })
}

export function getAttr (parameter) {
  return axios({
    url: api.attr,
    method: 'get',
    params: parameter
  })
}

export function saveGoods (parameter) {
  return axios({
    url: api.saveGoods,
    method: 'post',
    data: parameter
  })
}

export function getGoods (parameter) {
  return axios({
    url: api.getGoods,
    method: 'get',
    params: parameter
  })
}

export function updateStatus (parameter) {
  return axios({
    url: api.status,
    method: 'post',
    data: parameter
  })
}

export function deleteGoods (parameter) {
  return axios({
    url: api.deleteGoods,
    method: 'post',
    data: parameter
  })
}

export function getCat (parameter) {
  return axios({
    url: api.cat,
    method: 'get',
    params: parameter
  })
}

export function orderList (parameter) {
  return axios({
    url: api.orderList,
    method: 'get',
    params: parameter
  })
}

export function setting (parameter) {
  return axios({
    url: api.setting,
    method: 'get',
    params: parameter
  })
}

export function saveSetting (parameter) {
  return axios({
    url: api.saveSetting,
    method: 'post',
    data: parameter
  })
}

export function catList (parameter) {
  return axios({
    url: api.catList,
    method: 'post',
    data: parameter
  })
}

export function saveCat (parameter) {
  return axios({
    url: api.saveCat,
    method: 'post',
    data: parameter
  })
}

export function delCat (parameter) {
  return axios({
    url: api.delCat,
    method: 'post',
    data: parameter
  })
}

export function storeSetting (parameter) {
  return axios({
    url: api.storeSetting,
    method: 'post',
    data: parameter
  })
}

export function getStoreSetting (parameter) {
  return axios({
    url: api.storeSetting,
    method: 'get',
    params: parameter
  })
}

export function catStatus (parameter) {
  return axios({
    url: api.catStatus,
    method: 'post',
    data: parameter
  })
}

export function allCatList (parameter) {
  return axios({
    url: api.allCatList,
    method: 'get',
    params: parameter
  })
}
